package com.qf.student.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author author
 * @since 2022-11-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("rc_course")
@ApiModel(value="Course对象", description="")
public class Course implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "course_id", type = IdType.AUTO)
    private Integer courseId;

    @NotNull(message = "老师id必须输入数字")
    private Integer courseTeacherId;

    @Size(min = 2, message = "课程名称至少两个字符")
    private String courseName;

    @Range(min = 1000, max = 9999, message = "年级必须是四位的数字")
    private Integer courseGrade;

    @NotNull(message = "上课时间不能为空")
    private String courseTime;

    @Size(min = 3, message = "上课地点至少三个字符")
    private String courseLocation;

    @Range(min = 1, max = 5, message = "课程分数应该1~5之间")
    private Integer courseCredit;

    private Integer courseSelectedCount;

    @Range(min = 10, max = 100, message = "选课人数应该在10~100之间")
    private Integer courseMaxSize;

    private LocalDateTime courseExamDate;

    @Size(min = 3, message = "考试地点至少3个字符")
    private String courseExamLocation;

}
